// components/my-navbar/my-navbar.js
Component({
  data: {
    top: 20
  },
  options: {
    multipleSlots: true // 在组件定义时的选项中启用多 slot 支持
  },
  lifetimes: {
    created() {
      // console.log('created')
      // 视图不会更新
      // this.setData({ msg: '你好' })
    },
    attached() {
      const res = wx.getSystemInfoSync()
      console.log('attached', res.statusBarHeight)
      this.setData({ top: res.statusBarHeight })
    }
  }
})
